package com.xiaoyao.myframeapp.utils;

import android.widget.Toast;

import com.xiaoyao.myframeapp.FrameApplication;


/**
 * @author xiaoyao
 * @mail xiao80206040@qq.com
 * @explain Toast简化
 * @Created by Administrator on 2017/2/27 0027.
 */
public class ToastUtil {
    public static Toast toast;

    public static void setToast(String str) {

        if (toast == null) {
            toast = Toast.makeText(FrameApplication.getmContext(), str, Toast.LENGTH_SHORT);
        } else {
            toast.setText(str);
        }
        toast.show();
    }

    public static void setToast(int str) {

        if (toast == null) {
            toast = Toast.makeText(FrameApplication.getmContext(), str, Toast.LENGTH_SHORT);
        } else {
            toast.setText(str);
        }
        toast.show();
    }
}
